﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.ComponentModel.DataAnnotations;

namespace _2022_2_28.Areas.StudentArea.Models.Students
{
    public class UserMessage
    {
        public Guid Id { get; set; }
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "姓名")]
        public string Name { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Range(1970, 2022)]
        [Display(Name = "年份")]
        public int Year { get; set; }


        [Required(ErrorMessage = "{0}不能为空")]
        [Range(1, 12)]
        [Display(Name = "月份")]
        public int Month { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Range(1, 31)]
        [Display(Name = "日期")]
        public int Date { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(10)]
        [Display(Name = "性别")]
        public string Gender { get; set; }


        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Remote("ValidateTel", ErrorMessage = "{0}已存在")] //这个特性我们需要对这个值进行验证,验证唯一性
        [Display(Name = "联系电话")]
        public string Tel { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "邮件地址")]
        public string Email { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "QQ号码")]
        public string QQNumber { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "家庭住址")]
        public string Address { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "邮件地址")]
        public string WeChat { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [Display(Name = "班级编号")]
        public Guid GradesId { get; set; }

        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50)]
        [Display(Name = "头像")]
        public string Photo { get; set; }
    }
}
